ostree-prepare-root: Don't require an extraneous argument
authorColin Walters <walters@verbum.org>
Mon, 3 Jun 2013 02:18:19 +0000 (22:18 -0400)
committerColin Walters <walters@verbum.org>
Mon, 3 Jun 2013 02:19:24 +0000 (22:19 -0400)
src/switchroot/ostree-prepare-root.c

index 65bb73054a1a3a73df046d16f486ecbd1e52f34d..470ed3c7a932e91b5d1f3afd5465e86010b057ce 100644 (file)
@@ -82,7 +82,7 @@ parse_ostree_cmdline (char **out_osname,
     {
       const char *next = strchr (iter, ' ');
       const char *next_nonspc = next;
-      while (*next_nonspc == ' ')
+      while (next_nonspc && *next_nonspc == ' ')
        next_nonspc += 1;
       if (strncmp (iter, "ostree=", strlen ("ostree=")) == 0)
         {
@@ -121,9 +121,9 @@ main(int argc, char *argv[])
   size_t len;
   int i;
 
-  if (argc < 3)
+  if (argc < 2)
     {
-      fprintf (stderr, "usage: ostree-prepare-root SYSROOT OSTREE\n");
+      fprintf (stderr, "usage: ostree-prepare-root SYSROOT\n");
       exit (1);
     }